<?php
session_start();
require_once '../../Lib/main.php';
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
$url = "";
if (Controller_LoginController::login($username, $password)) {
	Controller_LoginController::unsetLoginError();
	$url = 'index.php';
} else {
	$error = "Sai username hoặc password";
	Controller_LoginController::setLoginError($error);
	$url = 'login.php';
}
?>
<script type="text/javascript" src="../js/custom.js"></script>
<script type="text/javascript">
 	goTo('../<?php echo $url;?>');
</script>
